package com.jb.workflow.app.client;

import java.util.List;

public class WfUtil {
	public static String getProcessName(String processId) {
		if (processId.contains("orderworkflow")) {
			return "订单工作流";
		} else if (processId.contains("leave")) {
			return "请假工作流";
		}
		
		return "";
	}
	
	public static String parseJsonDate(String date) {
		String rawDate = date.replace('T', ' ');
		String[] rawArr = rawDate.split("\\+");//分割时区
		if (rawArr.length >= 1) {
			return rawArr[0];
		}
		return "";
	}
	
//	/**
//	 * 获得当前处于的阶段，默认得到输入的开始，所以1条commentCount是库房的开始
//	 * @param commentCount
//	 * @return
//	 */
//	public static String getStepStart(int commentCount) {
//		
//		String step = "Unknown";
//		if (commentCount < 0 || commentCount > stepDespcription.length - 1) {
//			return step;
//		}
//		
//		try {
//			step = stepDespcription[commentCount];
//		} catch (Exception e) {
//			step = "Unknown";
//		}
//		return step;
//	}
//	
//	/**
//	 * 获得当前阶段是哪个阶段的结束，所以1条commentCount是客服下单的结束
//	 * @param commentCount
//	 * @return
//	 */
//	public static String getStepEnd(int commentCount) {
//		return getStepStart(commentCount - 1);
//	}
//	
//	public static boolean getFinished(int commentCount) {
//		return commentCount == 5;
//	}
	
	public static final String[] stepDespcriptionWithDriver = new String[]{
		"客服下单", 
		"库房接单提货", 
		"客服安排司机发货", 
		"司机发货", 
		"客服回传发货单", 
		"流程结束"};
	
	public static final String[] stepDespcriptionWithNotDriver = new String[]{
		"客服下单", 
		"库房接单提货", 
		"客服回传发货单", 
		"流程结束"};
}
